CentOS 7
Sponsored Link

OpenStack Pike : How to use Ceilometer(Glance)
2017/09/27
 
This is how to use OpenStack Telemetry Service (Ceilometer) for Glance service.
This example is based on the emvironment like follows.
     ------------+---------------------------+---------------------------+------------
                 |                           |                           |
             eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
     +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
     |    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
     |                       |   |                       |   |                       |
     |  MariaDB    RabbitMQ  |   |      Open_vSwitch     |   |        Libvirt        |
     |  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
     |  Keystone   Glance    |   |        L3_Agent       |   |      Open_vSwitch     |
     |  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
     |  Neutron_Server       |   |     Cinder_Volume     |   |  Ceilometer_Compute   |
     |  Metadata_Agent       |   |        Heat_API       |   |                       |
     |  Gnocchi              |   |      Heat Engine      |   |                       |
     |  Ceilometer_Central   |   |                       |   |                       |
     +-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Glance service to enable Telemetry data collention like follows.
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
vi /etc/glance/glance-registry.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
systemctl restart openstack-glance-api openstack-glance-registry

[2] It's some example to display metrics and meters.
# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------+----------------------------------+
| id                                   | type     | project_id                       |
+--------------------------------------+----------+----------------------------------+
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance | 27f776933c3b469ba0c07deba6b57752 |
+--------------------------------------+----------+----------------------------------+
----------------------------------+--------------------------------------+----------------------------------+
 user_id                          | original_resource_id                 | started_at                       |
----------------------------------+--------------------------------------+----------------------------------+
 8145f0cd8aab4d00b36f2d2da4ba5337 | 81563c32-75b3-4426-a0a9-95390d6fddf5 | 2017-09-29T06:13:49.003232+00:00 |
----------------------------------+--------------------------------------+----------------------------------+
----------+----------------------------------+--------------+-----------------------------------------------+
 ended_at | revision_start                   | revision_end | creator                                       |
----------+----------------------------------+--------------+-----------------------------------------------+
 None     | 2017-09-29T06:13:49.003272+00:00 | None         | f3ddbcb50b35481786dc468e49181678:626d31665c71 |
----------+----------------------------------+--------------+-----------------------------------------------+

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS7" --file centos7.qcow2 --disk-format qcow2 --container-format bare --public

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos73.qcow2 CentOS7

# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------+----
| id                                   | type                       | project_id                       | ...
+--------------------------------------+----------------------------+----------------------------------+----
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance                   | 27f776933c3b469ba0c07deba6b57752 | ...
| e6ce9362-3045-40f4-80c5-00cbaeb0c218 | image                      | 27f776933c3b469ba0c07deba6b57752 | ...
+--------------------------------------+----------------------------+----------------------------------+----

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show e6ce9362-3045-40f4-80c5-00cbaeb0c218

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 626d31665c7140ab82d88b78c4073798                                  |
| created_by_user_id    | f3ddbcb50b35481786dc468e49181678                                  |
| creator               | f3ddbcb50b35481786dc468e49181678:626d31665c7140ab82d88b78c4073798 |
| ended_at              | None                                                              |
| id                    | e6ce9362-3045-40f4-80c5-00cbaeb0c218                              |
| metrics               | image.download: b34d8e04-ad05-4689-b08e-77303e6680d9              |
|                       | image.serve: 0479bc10-8a68-4916-8415-7bead84f2ff3                 |
|                       | image.size: 76fbe18f-0b3b-4263-bc72-42779395a3fa                  |
| original_resource_id  | e6ce9362-3045-40f4-80c5-00cbaeb0c218                              |
| project_id            | 27f776933c3b469ba0c07deba6b57752                                  |
| revision_end          | None                                                              |
| revision_start        | 2017-09-29T07:46:29.271666+00:00                                  |
| started_at            | 2017-09-29T07:46:29.271630+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download

[root@dlp ~(keystone)]#
openstack metric measures show b34d8e04-ad05-4689-b08e-77303e6680d9

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2017-09-29T07:50:00+00:00 |       300.0 | 1377501184.0 |
+---------------------------+-------------+--------------+

# display image size

[root@dlp ~(keystone)]#
openstack metric measures show 76fbe18f-0b3b-4263-bc72-42779395a3fa

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2017-09-29T07:45:00+00:00 |       300.0 | 1377501184.0 |
+---------------------------+-------------+--------------+
 
Tweet